<?php

include '../lib/database.php';

$con = Database::connect();
$query = "SELECT * FROM tbl_departamento ORDER BY id_departamento";
$stmt = $con->prepare( $query );
$stmt->execute();

$num = $stmt->rowCount();

if($num>0){
	
	while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
		//exraer row
		
		extract($row);
		echo '<option value="'.$id_departamento.'">'.$nombre_departamento.'</option>';
	}

}

?>